# !/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
===========================
@Time : 2022/7/12 0012 21:58
@Author : 测试开发工程师
@File : utils_yaml_path.py
@Software: PyCharm
============================
"""

import os
import yaml


class Utils:

    @classmethod
    def get_yaml_data(cls, file_path):
        '''
        封装 yaml 读取
        :param file_path: 文件路径
        :return: 返回yaml数据体
        '''
        with open(file_path, encoding="utf-8") as f:
            datas = yaml.safe_load(f)
        return datas

    @classmethod
    def get_frame_root_path(self):
        """
        返回 D:\Project_Workspace\Auto\apitest\Test_frame 项目根路径
        @return:
        """
        return os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
